import 'package:after_sale_plugin/pages/order_detail/cell/problem_content_view.dart';
import 'package:get/get.dart';
import 'package:lx_widgets_library/lx_widgets_library.dart';
import 'package:wechat_assets_picker_plus/wechat_assets_picker_plus.dart';

import '../models/order_model.dart';

class OrderDetailState {
  // 工单id
  String id = "";

  // 工单进度状态
  Rx<OrderProgressState> orderProgressState = OrderProgressState.submited.obs;

  // 是否显示feedback
  RxBool showFeedbackAssets = false.obs;

  // 是否补充资源文件
  RxBool needToSupplementAssets = true.obs;
  RxString supplementContent = ''.obs;
  RxList<AssetModel> supplementAssets = <AssetModel>[].obs;
  // 补充的资源文件是否上传完成
  RxBool allowedSubmit = false.obs;
  // 补充的资源文件是否上传完成
  RxBool supplementAssetsUploadCompleted = false.obs;

  // 客服反馈内容
  final RxString feedbackContent = ''.obs;

  // 问题描述的内容
  RxString problemDescContent = ''.obs;

  // 追加的问题内容
  RxString problemResolutionContent = ''.obs;

  // 工单评价状态 - 默认未选择 （只有OrderProgressState .completed / .closed 才会显示）
  Rx<ProblemResolvedState> problemResolvedState =
      ProblemResolvedState.unselected.obs;

  // 工单信息
  RxList<LxBaseModel> orderInfos = [
    LxBaseModel()
      ..bigTitle.value = AppLanguageUtil.to.titleOrderNumber
      ..val.value = '',
    LxBaseModel()
      ..bigTitle.value = AppLanguageUtil.to.titleOrderRepairTime
      ..val.value = '',
  ].obs;

  // 报修详情
  RxList<LxBaseModel> repairDetails = [
    LxBaseModel()
      ..bigTitle.value = AppLanguageUtil.to.titleOrderRepairModel
      ..val.value = '',
    LxBaseModel()
      ..bigTitle.value = 'SN'
      ..val.value = '',
    LxBaseModel()
      ..bigTitle.value = AppLanguageUtil.to.titleReportType
      ..val.value = '',
  ].obs;

  // 车辆错误信息
  Rx<ReportOrderInfo> reportOrderInfo = ReportOrderInfo.fromMap({}).obs;

  // 报修的资源文件
  RxList<AssetModel> repairAssets = <AssetModel>[].obs;

  // 工单记录
  RxList<LxBaseModel> orderHistorys = [
    LxBaseModel()
      ..bigTitle.value = AppLanguageUtil.to.titleOrderSubmitedTime
      ..val.value = '',
    LxBaseModel()
      ..bigTitle.value = AppLanguageUtil.to.titleOrderProcessing
      ..val.value = '',
    LxBaseModel()
      ..bigTitle.value = AppLanguageUtil.to.titleCompletionTime
      ..val.value = '',
    LxBaseModel()
      ..bigTitle.value = AppLanguageUtil.to.titleClosingTime
      ..val.value = '',
  ].obs;
}
